import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home/Home.vue'
import footer from '@/views/layout/footer.vue'
import detialfooter from '@/components/detial/detialfooter.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      components: { default: Home, footer: footer }
    },
    {
      path: '/special',
      name: 'special',
      components: { default: () => import('@/views/special/special.vue'), footer: footer }
    },
    {
      path: '/cate',
      name: 'cate',
      components: { default: () => import('@/views/cate/cate.vue'), footer: footer }
    },
    {
      path: '/clickcate',
      name: 'clickcate',
      components: { default: () => import('@/views/cate/clickcate.vue') }
    },
    {
      path: '/cart',
      name: 'cart',
      components: { default: () => import('@/views/cart/cart.vue'), footer: footer }
    },
    {
      path: '/self',
      name: 'self',
      components: { default: () => import('@/views/self/self.vue'), footer: footer }
    },
    {
      path: '/brdetl',
      name: 'brdetl',
      components: { default: () => import('@/components/detial/brandlistdetial.vue') }
    },
    {
      path: '/hotnew',
      name: 'hotnew',
      components: { default: () => import('@/components/detial/hotandnewdetial.vue') }
    },
    {
      path: '/topdet',
      name: 'topdet',
      components: { default: () => import('@/components/detial/topdetial.vue') }
    },
    {
      path: '/detial/:id',
      name: 'detial',
      components: { default: () => import('@/components/detial/detial.vue'), footer: detialfooter }
    },
    {
      path: '/detiall/:id',
      name: 'detiall',
      components: { default: () => import('@/components/detial/detiall.vue'), footer: detialfooter }
    },
    {
      path: '/catelistcate',
      name: 'catelistcate',
      components: { default: () => import('@/views/cate/cateListClick.vue') }
    },
    {
      path: '/search',
      name: 'search',
      components: { default: () => import('@/views/search/searchPage.vue') }
    },
    {
      path: '/list',
      name: 'list',
      components: { default: () => import('@/views/list/searchList.vue') }
    },
    {
      path: '/address',
      name: 'address',
      components: { default: () => import('@/views/self/address.vue') }
    },
    {
      path: '/addaddress',
      name: 'addaddress',
      components: { default: () => import('@/components/address/addaddress.vue') }
    },
    {
      path: '/feedback',
      name: 'feedback',
      components: { default: () => import('@/views/self/feedback.vue') }
    },
    {
      path: '/order',
      name: 'order',
      components: { default: () => import('@/components/order/order.vue') }
    },
    {
      path: '/orderphoto',
      name: 'orderphoto',
      components: { default: () => import('@/components/order/orderphoto.vue') }
    },
    {
      path: '/register',
      name: 'register',
      components: { default: () => import('@/views/register/register.vue') }
    },
    {
      path: '/login',
      name: 'login',
      components: { default: () => import('@/views/login/login.vue') }
    }
  ],

})
export default router
